package com.etonedu.meals.machine;

import com.ys.rkapi.MyManager;

import org.xutils.x;

public class DeviceManager {

    private MyManager manager;
    private static DeviceManager self;

    private DeviceManager() {
        manager = MyManager.getInstance(x.app());
        manager.bindAIDLService(x.app());
    }

    public static DeviceManager getInstance() {
        if (self == null) {
            self = new DeviceManager();
        }
        return self;
    }

    public void turnOnBackLight() {
        manager.turnOnBackLight();
    }

    public void turnOffBackLight(){
        manager.turnOffBackLight();;
    }

    public void unBind() {
        if (manager != null) {
            manager.unBindAIDLService(x.app());
            self = null;
        }
    }
}
